{layout name="layout2" /}
<style>
    .img-content{
        height:80px;
        line-height:80px
    }
    .img-container {
        float: left;
        opacity: 1;
        position: relative;
    }

    .img-src {
        width: 80px;
        height: 80px;
        padding: 4px;
    }
    .img-del-x {
        position: absolute;
        z-index: 100;
        top: -4px;
        right: -2px;
        width: 20px;
        height: 20px;
        font-size: 16px;
        line-height: 16px;
        color: #fff;
        text-align: center;
        cursor: pointer;
        background: hsla(0, 0%, 60%, .6);
        border-radius: 10px;
    }
    .layui-form-item .layui-input-inline{
        margin-top:10px;
    }
    .layui-form-label {
        color: #6a6f6c;
        width: 130px;
        line-height: 15px;
    }
    #container {
        margin-left: 130px;
        width: 60%;
        height: 60%;
    }
    .tips{
        color: red;
    }
    .goods-li {
        float: left;
        opacity: 1;
        position: relative;
    }

    .goods-img {
        width: 80px;
        height: 80px;
        padding: 4px;
    }
    .goods-img-del-x {
        position: absolute;
        z-index: 100;
        top: -4px;
        right: -2px;
        width: 20px;
        height: 20px;
        font-size: 16px;
        line-height: 16px;
        color: #fff;
        text-align: center;
        cursor: pointer;
        background: hsla(0, 0%, 60%, .6);
        border-radius: 10px;
    }

    #image{
        left:110px;
    }
    .layui-input-block{
        margin-bottom: 10px;
        margin-left:160px;
    }

</style>
<script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&libraries=service&key=E2WBZ-XPM3B-VTOUQ-NZQTD-KHBHT-ZYBVF"></script>
<div class="layui-form" lay-filter="layuiadmin-form-user" id="layuiadmin-form-user" style="padding: 20px 30px 0 0;">

   <input type="hidden" name="id" value="{$info.id}">

<!--    <div class="layui-form-item">-->
<!--        <fieldset class="layui-elem-field layui-field-title">-->
<!--            <legend>必填模块</legend>-->
<!--        </fieldset>-->



<!--        <label class="layui-form-label"><span class="tips">*</span>充装站：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <select name="site_id" class="layui-input"  disabled>-->
<!--                <option value="">请选择充装站</option>-->
<!--                {foreach $bottle_site_list as $val}-->
<!--                <option value="{$val.id}" {if $info.site_id == $val.id}selected{/if} >{$val.name}</option>-->
<!--                {/foreach}-->
<!--            </select>-->
<!--        </div>-->
<!--        <label class="layui-form-label"><span class="tips">*</span>是否有电梯：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="radio" name="if_elevator" value="1" title="是" {if $info.if_elevator == 1}checked{/if}>-->
<!--            <input type="radio" name="if_elevator" value="0" title="否" {if $info.if_elevator == 0}checked{/if}>-->
<!--        </div>-->
<!--    </div>-->
    <div class="layui-form-item">
<!--        <fieldset class="layui-elem-field layui-field-title">-->
<!--            <legend>非必填模块</legend>-->
<!--        </fieldset>-->
        <label class="layui-form-label"><span class="tips">*</span>用户类型：</label>
        <div class="layui-input-block">
            <select name="type" class="layui-input">
                <option value="">请选择用户类型{$info.type}</option>
                <option value="1" {if condition="$info.type == 1"}selected{/if}>商户</option>
                <option value="2" {if condition="$info.type == 2"}selected{/if}>家庭用户</option>
            </select>
        </div>
        <label class="layui-form-label"><span class="tips">*</span>
            用气单位/人名称：</label>
        <div class="layui-input-block">
            <input type="text" name="name" value="{$info.name}" lay-verify="required" lay-verType="tips" placeholder="用气单位/人名称" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label"><span class="tips">*</span>用户账号</label>
        <div class="layui-input-block">
            <input type="text" name="mobile" value="{$info.mobile}" lay-verify="required" lay-verType="tips" placeholder="联系电话" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">收货人号码</label>
            <div class="layui-input-block">
                <input type="text" name="telephone" value="{$info.telephone}" lay-verify="required" lay-verType="tips" placeholder="联系电话" autocomplete="off" class="layui-input">
            </div>
        </div>
        <label id="panel" class="layui-form-label"><span class="tips">*</span>所在位置-省市区：</label>
        <div class="layui-input-block">
            <input id='address' name="address" value="{$info.address}" type="text" value='' class="btn layui-input" placeholder="请输入省市区街道门牌号 然后点击转换坐标">
            <input id="convert" type="button" class="layui-btn layui-btn-xs" value="转换坐标" onclick="convert()" />
            <a href="https://lbs.qq.com/getPoint/" target="_blank" style="color:#01AAED"><i class="layui-icon layui-icon-link"></i>拾取坐标</a>
        </div>

        <!--        <label class="layui-form-label"><span class="tips">*</span>所在经度：</label>-->
        <!--        <div class="layui-input-block">-->
        <!--            <input type="text" id="longitude" name="longitude" value="{$info.longitude}" lay-verify="required" lay-verType="tips" placeholder="所在经度" autocomplete="off" class="layui-input">-->
        <!--        </div>-->
        <label class="layui-form-label"><span class="tips">*</span>所在经纬度：</label>
        <div class="layui-input-block">
            <input type="text" id="latitude" name="latitude" value="{$info.latitude}" lay-verify="required" lay-verType="tips" placeholder="所在纬度" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label"><span class="tips">*</span>详细地址：</label>
        <div class="layui-input-block">
            <input type="text" id="address_detail" name="address_detail" value="{$info.address_detail}" lay-verify="required" lay-verType="tips" placeholder="详细地址-门牌号" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label"><span class="tips">*</span>是否有电梯：</label>
        <div class="layui-input-block">
            <input type="radio" name="if_elevator" value="1" title="是" {if $info.if_elevator == 1}checked{/if}>
            <input type="radio" name="if_elevator" value="0" title="否" {if $info.if_elevator == 0}checked{/if}>
        </div>
        <label class="layui-form-label"><span class="tips">*</span>所在楼层：</label>
        <div class="layui-input-block">
            <input type="text" name="floor" value="{$info.floor}" lay-verify="required" lay-verType="tips" placeholder="所在楼层" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label">开户时间：</label>
        <div class="layui-input-block">
            <input type="text"  disabled="true" name="reg_time" id="reg_time" value="{$info.reg_time}" lay-verify="" lay-verType="tips" placeholder="开户时间" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label">押瓶金额：</label>
        <div class="layui-input-block">
            <input type="text" name="bottle_deposit" value="{$info.bottle_deposit}" lay-verify="" lay-verType="tips" placeholder="押瓶金额" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label">押瓶租金/天：</label>
        <div class="layui-input-block">
            <input type="text" name="bottle_rent" value="{$info.bottle_rent}" lay-verify="" lay-verType="tips" placeholder="押瓶租金/天" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label">账号状态：</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="1" title="正常" {if $info.status == 1}checked{/if}>
            <input type="radio" name="status" value="2" title="禁用" {if $info.status == 2}checked{/if}>
        </div>

<!--        <label class="layui-form-label">最近一次下单时间：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="text" disabled name="order_last_time" id="order_last_time" value="{$info.order_last_time}" lay-verify="" lay-verType="tips" placeholder="最近一次下单时间" autocomplete="off" class="layui-input">-->
<!--        </div>-->
        <label class="layui-form-label">优惠金额：</label>
        <div class="layui-input-block">
            <input type="text" name="discount_amount" value="{$info.discount_amount}"  lay-verify="" lay-verType="tips" placeholder="优惠金额" autocomplete="off" class="layui-input">
        </div>

<!--        <label class="layui-form-label"><span class="tips">*</span>是否有押瓶：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="text" name="if_bottle" lay-verify="" lay-verType="tips" placeholder="是否有押瓶" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--        <label class="layui-form-label"><span class="tips">*</span>我的押瓶数：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="text" disabled name="bottle_num" value="{$info.bottle_num}"  lay-verify="" lay-verType="tips" placeholder="我的押瓶数" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--        <label class="layui-form-label"><span class="tips">*</span>注册时间：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="text" disabled name="create_time" id="create_time" value="{$info.create_time}"  lay-verify="" lay-verType="tips" placeholder="注册时间" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--        <label class="layui-form-label"><span class="tips">*</span>是否删除：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="radio" name="del" value="1" title="是" checked>-->
<!--            <input type="radio" name="del" value="0" title="否" >-->
<!--        </div>-->
<!--        <label class="layui-form-label"><span class="tips">*</span>是否已下单：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="radio" name="if_order" value="1" title="是" {if $info.if_order == 1}checked{/if}>-->
<!--            <input type="radio" name="if_order" value="0" title="否" {if $info.if_order == 0}checked{/if}>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">用户头像</label>-->
<!--            <div class="layui-input-block">-->
<!--                <div style="height:80px;line-height:80px">-->
<!--                    <input name="avatar" type="hidden" value="{$info.avatar}">-->
<!--                    {if !empty($info.avatar)}-->
<!--                    <div class="goods-img-add" style="display: none" ></div>-->
<!--                    <div class="goods-li">-->
<!--                        <img class="goods-img" src="{$info.avatar}">-->
<!--                        <a class="goods-img-del-x" style="display: none">x</a>-->
<!--                    </div>-->
<!--                    {else}-->
<!--                    <div class="goods-img-add" ></div>-->
<!--                    {/if}-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="layui-input-block">-->
<!--                <label class=" layui-form-mid layui-word-aux" id="image">建议尺寸：500*500像素</label>-->
<!--            </div>-->
<!--        </div>-->
    </div>
    <!--地图组件显示-->
<!--    <div class="layui-form-item" id="container"></div>-->


<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>用户类型：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <select name="type" class="layui-input">-->
<!--                <option value="">请选择用户类型{$info.type}</option>-->
<!--                <option value="1" {if condition="$info.type == 1"}selected{/if}>商户</option>-->
<!--                <option value="2" {if condition="$info.type == 2"}selected{/if}>家庭用户</option>-->
<!--                <option value="3" {if condition="$info.type == 3"}selected{/if}>经销商</option>-->
<!--            </select>-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>用气单位/人名称：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="text" name="name" value="{$info.name}" lay-verify="required" lay-verType="tips" placeholder="用气单位/人名称" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--    </div>-->


<!--    <div class="layui-form-item" id="container"></div>-->




<!--&lt;!&ndash;获取经纬度结束&ndash;&gt;-->

<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>所在经度：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="text" value="{$info.longitude}" id="longitude" name="longitude" lay-verify="required" lay-verType="tips" placeholder="所在经度" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>所在纬度：</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="text" id="latitude" value="{$info.latitude}" name="latitude" lay-verify="required" lay-verType="tips" placeholder="所在纬度" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>所在楼层：</label>-->
<!--        <div class="layui-input-inline">-->
<!--            <input type="text" name="floor" value="{$info.floor}" lay-verify="required" lay-verType="tips" placeholder="所在楼层" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>充装站：</label>-->
<!--        <div class="layui-input-inline">-->
<!--            <select name="site_id" class="layui-input">-->
<!--                <option value="">请选择充装站</option>-->
<!--                {foreach $bottle_site_list as $val}-->
<!--                <option value="{$val.id}">{$val.name}</option>-->
<!--                {/foreach}-->
<!--            </select>-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>是否有电梯：</label>-->
<!--        <div class="layui-input-inline">-->
<!--            <input type="radio" name="if_elevator" value="1" title="是" {if $info.if_elevator == 1}checked{/if}>-->
<!--            <input type="radio" name="if_elevator" value="0" title="否" {if $info.if_elevator == 0}checked{/if}>-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>钢瓶租金/每月：</label>-->
<!--        <div class="layui-input-inline">-->
<!--            <input type="text" name="bottle_rent" value="{$info.bottle_rent}" lay-verType="tips" placeholder="钢瓶租金/每月" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>押瓶金额：</label>-->
<!--        <div class="layui-input-inline">-->
<!--            <input type="text" name="bottle_deposit" value="{$info.bottle_deposit}" lay-verType="tips" placeholder="押瓶金额" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>用户状态：</label>-->
<!--        <div class="layui-input-inline">-->
<!--            <input type="radio" name="status" value="1" title="正常" {if $info.status == 1}checked{/if}>-->
<!--            <input type="radio" name="status" value="2" title="禁用" {if $info.status == 0}checked{/if}>-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label"><span class="tips">*</span>优惠金额</label>-->
<!--        <div class="layui-input-inline">-->
<!--            <input type="text" name="discount_amount" value="{$info.discount_amount}" lay-verType="tips" placeholder="优惠金额" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--    </div>-->
   
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="edit-submit"  id="edit-submit" value="确认">
    </div>
</div>
<script>
    layui.config({
        version:"{$front_version}",
        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form','laydate','like'], function(){
        var $ = layui.$
            ,form = layui.form
            ,laydate = layui.laydate
            ,like = layui.like;
        laydate.render({
            elem: '#reg_time'
            // ,format: 'yyyy-MM-dd H:i'
            ,type: 'datetime'
            ,trigger: 'click'
        });
        laydate.render({
            elem: '#order_last_time'
            // ,format: 'yyyy-MM-dd H:i'
            ,type: 'datetime'
            ,trigger: 'click'
        });
        laydate.render({
            elem: '#create_time'
            // ,format: 'yyyy-MM-dd H:i'
            ,type: 'datetime'
            ,trigger: 'click'
        });
        //上传图片
        like.imageUpload('.goods-img-add', function (uri, element) {
            if(uri.length>1){
                layer.msg('最多最能选中1张图片');
                return;
            }
            var html = '<div class="goods-li">\n' +
                '<img class="goods-img" ' +
                'src="' + uri[0] + '">' +
                '<a class="goods-img-del-x">x</a>' +
                '</div>';
            element.prev().val(like.getUrlFileName(uri[0], '{$storageUrl}'));
            element.parent().append(html);
            element.css('display','none');
        }, true);
        //删除图片
        $(document).on('click', '.goods-img-del-x', function () {
            $(this).parent().siblings('input').val('');
            $(this).parent().prev().css('display','block');
            $(this).parent().remove();
        });
        //显示图片
        $(document).on('click', '.goods-img', function () {
            var image = $(this).attr('src');
            like.showImg(image,600);
        });

        //  删除按钮的显示与隐藏
        $(document).on('mouseover', '.goods-img', function () {
            $(this).next().show();
        });
        $(document).on('mouseout', '.goods-img', function () {
            $(this).next().hide();
        });
        $(document).on('mouseover', '.goods-img-del-x', function () {
            $(this).show();
        });
        $(document).on('mouseout', '.goods-img-del-x', function () {
            $(this).hide();
        });

        form.on('select(category)', function(data){
            var level = $(data.elem).find("option:selected").attr("data-level");
            $('.alliance_ratio').hide();
            $('.autotrophy_ratio').hide();
            if(level == 2){
                $('.alliance_ratio').show();
                $('.autotrophy_ratio').show();

            }
        });

    })
    var map = new TMap.Map('container', {
  zoom: 14,
  center: new TMap.LatLng(28.24826,113.1155 ),
});
var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
var markers = new TMap.MultiMarker({
  map: map,
  geometries: [],
});


function convert() {
    console.log("获取地址",document.getElementById('address').value)
  markers.setGeometries([]);
  // 将给定的地址转换为坐标位置
  geocoder
    .getLocation({ address: document.getElementById('address').value })
    .then((result) => {
      markers.updateGeometries([
        {
          id: 'main',
          position: result.result.location, // 将得到的坐标位置用点标记标注在地图上
        },
      ]);
      map.setCenter(result.result.location);
      // document.getElementById(
      //   'longitude'
      // ).value = result.result.location;
      //result.result.location.lng.lat;
      document.getElementById(
        'latitude'
      ).value = result.result.location;
      
      // 显示坐标数值
    });
}
convert();
</script>